package com.example.common.constants;

import java.util.HashMap;
import java.util.Map;

public class RoleConstants {
    public static final String STUDENT = "student";
    public static final String TEACHER = "teacher";
    public static final String ADMIN = "admin";
    // 教师模块映射
    public static final Map<String, String> TEACHER_MODULE_MAP = new HashMap<>();
    // 学生模块映射
    public static final Map<String, String> STUDENT_MODULE_MAP = new HashMap<>();

    static {
        // 初始化教师模块
        TEACHER_MODULE_MAP.put("course", "备课模块");
        TEACHER_MODULE_MAP.put("exercise", "练习模块");
        TEACHER_MODULE_MAP.put("exam", "考核模块");
        TEACHER_MODULE_MAP.put("resource", "资源模块");

        // 初始化学生模块
        STUDENT_MODULE_MAP.put("learning", "学习模块");
        STUDENT_MODULE_MAP.put("practice", "练习模块");
        STUDENT_MODULE_MAP.put("test", "考试模块");
        STUDENT_MODULE_MAP.put("question", "答疑模块");
    }

    // 可选：提供一个通用查找方法
    public static String getModuleName(Map<String, String> moduleMap, String path) {
        for (Map.Entry<String, String> entry : moduleMap.entrySet()) {
            if (path.startsWith(entry.getKey())) {
                return entry.getValue();
            }
        }
        return null;
    }

}
